package com.homedo.rxj;

import io.reactivex.Observable;
import io.reactivex.functions.Consumer;

import java.util.concurrent.TimeUnit;

public class RxjTest6 {

    public static void main(String[] args) throws InterruptedException {
        Observable observable = createObserver();

        observable.subscribe(new Consumer<Long>() {
            @Override
            public void accept(Long aLong) throws Exception {
                System.out.println(Thread.currentThread() + "--");
            }
        });
//        TimeUnit.SECONDS.sleep(10);
    }


    private static Observable createObserver() {
        return Observable.interval(1, 1, TimeUnit.SECONDS);

    }
}
